﻿using System;
using System.Collections.Generic;
using System.Text;
using Nissen_Dao;
using Nissen_Model;

namespace Nissen_Manage.Forms
{
    public class AnswerPaperService
    {
        private readonly AnswerPaperDao _answerPaperDao;

        public AnswerPaperService()
        {
            _answerPaperDao = new AnswerPaperDao();
        }

        public IList<AnswerPaper> GetAnswerPapers(String subjectCourseId, String subjectCoursePage)
        {
            return
            _answerPaperDao.GetAnswerPapers(subjectCourseId, subjectCoursePage);
        }

        public IList<AnswerPaper> GetAnswerPapersBySubjectCourseId(String subjectCourseId)
        {
            return
            _answerPaperDao.GetAnswerPapersSubjectCourseId(subjectCourseId);
        }

        public void AddAnswerPaper(IList<AnswerPaper> answerPapers)
        {
            _answerPaperDao.SaveOrUpdate(answerPapers);
        }

        public void RemoveAnswerPaper(AnswerPaper answerPaper)
        {
            _answerPaperDao.Delete(answerPaper);
        }
    }
}
